#include "font.h"

void Font::Load(std::string filename)
{
    std::map<std::string, sf::Font>::iterator it;

    it = fontMap.find(filename);

    //Font is not loaded into memory
    if (it == fontMap.end())
    {
        sf::Font tempFont;
        tempFont.loadFromFile(filename);
        fontMap[filename] = tempFont;
    }
}

sf::Font& Font::Get(std::string filename)
{
    std::map<std::string, sf::Font>::iterator it;

    it = fontMap.find(filename);

    if (it == fontMap.end())
    {
        sf::Font tempFont;
        tempFont.loadFromFile(filename);
        fontMap[filename] = tempFont;
    }

    return fontMap[filename];
}

